<% content_for :stylesheets do %>
<%= stylesheet_link_tag '/skins/default/github' %>
<%= stylesheet_link_tag 'hightlight/github.min' %>
<% end %>

<table class="content">
  <tr>
    <th valign="top">文章标题</th>
    <td><%= form.text_field :title, :class => 'title' %></td>
  </tr>
  
  <tr>
    <th valign="top">文章内容</th>
    <td>
      <div class="blog_content_editor_tab clearfix">
        <a id="show_blog_content_editor" href="#" class="current">编辑器</a>
        <a id="show_blog_content_preview" href="#">预览文章</a>
      </div>
      <%= form.text_area :content %>
      <div id="blog_content_preview" class="con text"></div>
      <div>
        [<a href="http://wowubuntu.com/markdown/" target="_blank">Markdown中文帮助</a>]
        [<a href="https://help.github.com/articles/github-flavored-markdown" target="_blank">Github风格的Markdown格式</a>]
      </div>
    </td>
  </tr>
  
  <tr>
    <th valign="top">文章分类</th>
    <td>
      <label><%= form.radio_button :category, :value => 'blog' %> 博客文章(blog)</label>
      <label><%= form.radio_button :category, :value => 'note' %> 学习笔记(note)</label>
    </td>
  </tr>
  
  <tr>
    <th valign="top">Tag</th>
    <td>
      <%= form.text_field :user_tags, :placeholder => '用逗号分开，不超过3个，Tag必须是字母数字空格下划线和中文' %>
      <div class="tag">
        <% Blog.cached_tag_cloud.each do |tag| %>
        <a href="#" class="tag" rel="tag"><span><%= tag %></span></a>
        <% end %>
      </div>
    </td>
  </tr>

  <tr>
    <th valign="top">附件</th>
    <td>
      <% unless @attachments.blank? %>
      已上传的文件：
      <%= partial 'admin/attachment', :collection => @attachments %>
      <% end %>
      上传新的文件：
      <div id="attachment_iframes">
        <iframe src="<%= url(:admin, :new_attachment) %>" style="border:0px;height:30px;width:100%;" frameborder="0" border="0" cellspacing="0" allowTransparency="true" scrolling="no" resizable="no"></iframe>
      </div>
      <ul>
        提示信息：
        <li class="note">上传文件请压缩后再上传，允许zip, rar, gz, tar, bz2, 7z, jar, war格式的压缩文件</li>
        <li class="note">上传图片推荐使用png, jpg, gif等类型</li>
        <li class="note">文件大小不能超过5MB</li>
      </ul>
    </td>
  </tr>

  <tr>
    <th valign="top">URL后缀</th>
    <td>
      <%= form.text_field :slug_url, :placeholder => '填写URL英文关键词，用-连接'  %>
    </td>
  </tr>

  <tr>
    <th valign="top">允许评论</th>
    <td>
      <%= form.check_box :commentable, :style => 'display:inline;' %>
      <div id="form-error-info"></div>
    </td>
  </tr>

  <tr>
    <th>&nbsp;</th>
    <td align="center">
      <%= form.submit '', :class => 'submit' %>
    </td>
  </tr>
</table>